from enum import Enum


class StrategyGroup(Enum):
    RISK = (0, "风险型策略")
    ATTENTION = (1, "关注型策略")
    PRE_PROCESS = (9, "前置处理")

    def __init__(self, code: int, description: str):
        self.code = code  # 数值标识
        self.description = description  # 中文描述

    def __str__(self):
        return f"{self.code}: {self.description}"
    
    @staticmethod
    def get_description_by_code(code: int) -> str:
        for group in StrategyGroup:
            if group.code == code:
                return group.description
        return "未知策略"  # 如果没有找到对应的策略代码，返回默认值